import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ProgressBar;
import org.eclipse.swt.SWT;

public class Progress
{
    public Progress(int max, Shell s)
    {
        shell = new Shell(s, SWT.NO_TRIM);
        bar = new ProgressBar(shell, SWT.SMOOTH | SWT.HORIZONTAL);
        bar.setBounds(0,0,400,80);

        bar.setMinimum(0);
        bar.setMaximum(max);
        bar.setSelection(0);

        shell.setBounds(200,200,400,80);
        shell.setMinimumSize(400,80);
        shell.pack();
        shell.open();
    }

    Shell shell;
    ProgressBar bar;

    public void dispose()
    {
        shell.close();
        shell.dispose();
    }

    public void step()
    {
         bar.setSelection(bar.getSelection() + 1);
    }
}
